var states = [{code: 1, text: '会议通知' }, {code: 2, text: '任免通知'},
	{code: 3, text : '事项通知'},{code: 4, text:'批转通知'}];
mini.parse();
var item2 = localStorage.getItem("item");
var userInfoObj = JSON.parse(item2);

var ue = UE.getEditor('content');

function getContent() {
    var arr = ue.getContent();
    alert(arr);
};
function setContent() {
    ue.setContent('MiniUI - 专业WebUI控件库');
};
function setDisabled() {

    ue.setDisabled('fullscreen');

};
function setEnabled() {
    ue.setEnabled();
}

function onOk(ida) {
	
	var url = ajaxUrl + "/BeeperController/save.do";
	
	var subject = mini.get("subject").getValue();
	var provider = userInfoObj.uName;
	var provider_id = userInfoObj.userId;
	var type = mini.get("type").getValue();
	var beeper_time = mini.get("beeper_time").getValue();
	var content = ue.getPlainTxt();

	$.ajax({
		type    : 'post',
		url     : url,
		//contentType : "application/json",
		data    : {
			subject      : subject,
			provider     : provider,
			provider_id  : provider_id,
			type         : type,
			beeper_time  : beeper_time,
			content      : content,
			publish      : 0
		},
		success : function(data){
			console.log(data)
			mini.alert(data.data.message);
			
		},
		error   : function(){
			
		}
	})
}
	//校验模块必输
function onNotSpaceValidation(e) {
    if (e.isValid) {
        if (!e.value) {
            e.errorText = "不能为空";
            e.isValid = false;
        }
    }
}
	
function saveAndRelease(){
var url = ajaxUrl + "/BeeperController/save.do";
	
	var subject = mini.get("subject").getValue();
	var provider = userInfoObj.uName;
	var provider_id = userInfoObj.userId;
	var type = mini.get("type").getValue();
	var beeper_time = mini.get("beeper_time").getValue();
	var content = ue.getPlainTxt();

	$.ajax({
		type    : 'post',
		url     : url,
		//contentType : "application/json",
		data    : {
			subject      : subject,
			provider     : provider,
			provider_id  : provider_id,
			type         : type,
			beeper_time  : beeper_time,
			content      : content,
			publish      : 1
		},
		success : function(data){
			console.log(data)
			mini.alert(data.data.message);
			
		},
		error   : function(){
			
		}
	})
}

	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
